/* let arr = [1,2,3,4,5] */

//1,2,3,4,5....

/* f(n) = fn(n - 1) + f(n-2) */

/* const f = []
var climbStairs = function(n) {
    if(n==2){
        return 2
    }
    if(n==1){
        return 1
    }
    if(undefined){
   f[n] = climbStairs(n-1) + climbStairs(n-2)
    }
    return f[n]
};

climbStairs(n) */

var climbStairs = function(n) {
    const f = []
    f[1] = 1
    f[2] = 2
    for(let i =3 ;i<=n;i++){
        f[i] = f[i-1] + f[i-2]
    }
    return f[n]
};